/**
 * @description sequelize 同步数据库
 * @author shen 
 */

const seq = require('./seq')

// 测试连接成功与否
seq.authenticate().then(() => {
    console.log('sync ok')
}).catch(() => {
    console.log('sync fail')
})

// 执行同步，force:true 会把原来Mysql中的表清空，再重新建表
seq.sync({ force: true }).then(() => {
    console.log('sync ok')
    process.exit()
})